home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / initialGUI.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  17.0 KB  |  484 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Sept 1996
  22. //  Author:         dsw
  23. //
  24. //  Description:
  25. //      This script performs various GUI startup related tasks.
  26. //        It is run only in GUI mode and not batch mode.
  27. //
  28. //  Input Arguments:
  29. //      None.
  30. //
  31. //  Return Value:
  32. //      None.
  33. //
  34. //  Note:
  35. //      None.
  36. // 
  37.  
  38.     //
  39.     // Set up some defaults for the tear-off panel sizes.
  40.     // Normally, these windows use the last panel size but in
  41.     // some cases this isn't a good fit.
  42.     //
  43.     windowPref -tlc 225 150 -wh 250 400 outlinerPanel1Window;
  44.     windowPref -tlc 250 200 -wh 700 400 hyperGraphPanel1Window;
  45.     windowPref -tlc 250 200 -wh 660 400 graphEditor1Window;
  46.     windowPref -tlc 250 200 -wh 660 400 dopeSheetPanel1Window;
  47.     windowPref -tlc 250 200 -wh 660 400 clipEditorPanel1Window;
  48.     windowPref -tlc 250 200 -wh 560 430 multiListerPanel1Window;
  49.     windowPref -tlc 250 200 -wh 524 470 devicePanel1Window;
  50.     windowPref -tlc 250 200 -wh 700 400 hyperShadePanel1Window;
  51.     windowPref -tlc 250 200 -wh 700 400 dynPaintScriptedPanelWindow;
  52.  
  53.     //
  54.     //  General
  55.     //
  56.     translator -cmp `optionVar -q fileCompressionMode`;
  57.  
  58.     snapMode 
  59.         -useTolerance `optionVar -q useSnapTolerance`
  60.         -tolerance `optionVar -q snapTolerance`
  61.         -uvTolerance `optionVar -q snapUVTolerance`
  62.         -edgeMagnet `optionVar -q snapMagnet`
  63.         -edgeMagnetTolerance `optionVar -q snapMagnetTolerance`;
  64.  
  65.     help -popupDisplayTime `optionVar -query helpPopupDisplayTime`;
  66.  
  67.     //
  68.     //  Selection
  69.     //
  70.     selectPref 
  71.         -singleBoxSelection `optionVar -q selectSingleMarquee`
  72.         -clickDrag `optionVar -q selectClickDrag`
  73.         -affectsActive `optionVar -q selectAffectsActive`
  74.         -allowHiliteSelection true
  75.         -ignoreSelectionPriority `optionVar -q ignoreSelectionPriority`
  76.         -popupMenuSelection `optionVar -q popupMenuSelection`
  77.         -expandPopupList `optionVar -q expandPopupList`
  78.         -clickBoxSize `optionVar -q clickBoxSize`;
  79.  
  80.     global string $gSelectPriorityMode;
  81.     global int $gCustomSelPriority[];
  82.     global int $gCustomSelPriorityCount = 56;
  83.  
  84.     $gSelectPriorityMode = `optionVar -q selectPrefPriorityMode`;
  85.     $gCustomSelPriority = `optionVar -q customSelectPriority`;
  86.     selPriority $gSelectPriorityMode;
  87.  
  88.     //
  89.     //  Display
  90.     //
  91.  
  92.     global int $gFastInteraction;
  93.     $gFastInteraction = `optionVar -q fastInteraction`;
  94.     displayLevelOfDetail -lod $gFastInteraction;
  95.  
  96.     displayPref -activeObjectPivots `optionVar -q activeObjectPivots`;
  97.     displayPref -displayAffected `optionVar -q displayAffected`;
  98.     displayPref -regionOfEffect `optionVar -q displayRegionOfEffect`;
  99.     displayPref -shadeTemplates `optionVar -q shadeTemplates`;
  100.     if (`optionVar -exists ghostFrameStep`) {
  101.         displayPref -ghostFrames `optionVar -q ghostFramesBefore` `optionVar -q ghostFramesAfter` `optionVar -q ghostFrameStep`;
  102.     }
  103.  
  104.     int $state = `optionVar -q wireframeOnShadedActive`;
  105.     if ( $state == 1 )
  106.         displayPref -wireframeOnShadedActive "full";
  107.     else if ( $state == 2 )
  108.         displayPref -wireframeOnShadedActive "reduced";
  109.     else if ( $state == 3 )
  110.         displayPref -wireframeOnShadedActive "none";
  111.  
  112.     toggleAxis -v `optionVar -q toggleViewAxis`
  113.                -o `optionVar -q toggleOriginAxis`;
  114.  
  115.     global string $gPreviousWorkingUnitLinear;
  116.  
  117.     global float $gGridSpacingDefault   = 5.0;
  118.     global float $gGridDivisionsDefault = 5.0;
  119.     global float $gGridSizeDefault      = 12.0;
  120.  
  121.     global int    $gGridDisplayAxesDefault            = true;
  122.     global int    $gGridDisplayGridLinesDefault       = true;
  123.     global int    $gGridDisplayDivisionLinesDefault   = true;
  124.     global int    $gGridDisplayGridPerspLabelsDefault = false;
  125.     global int    $gGridDisplayGridOrthoLabelsDefault = false;
  126.     global int    $gGridDisplayAxesAccentedDefault    = true;
  127.  
  128.     global string $gGridDisplayPerspLabelPositionDefault = "axis";
  129.     global string $gGridDisplayOrthoLabelPositionDefault = "edge";
  130.  
  131.     grid -default 
  132.          -spacing $gGridSpacingDefault
  133.          -divisions $gGridDivisionsDefault
  134.         -size                      $gGridSizeDefault
  135.         -displayAxes               $gGridDisplayAxesDefault
  136.         -displayGridLines          $gGridDisplayGridLinesDefault
  137.         -displayDivisionLines      $gGridDisplayDivisionLinesDefault
  138.         -displayPerspectiveLabels  $gGridDisplayGridPerspLabelsDefault
  139.         -displayOrthographicLabels $gGridDisplayGridOrthoLabelsDefault
  140.         -displayAxesBold           $gGridDisplayAxesAccentedDefault
  141.         -perspectiveLabelPosition  $gGridDisplayPerspLabelPositionDefault
  142.         -orthographicLabelPosition $gGridDisplayOrthoLabelPositionDefault
  143.         ;
  144.  
  145.     if( !`optionVar -exists gridSpacing`) {
  146.         // If there is no preference file:
  147.         //
  148.         // set to the linearUnit before start.
  149.         // 
  150.         currentUnit -l $gPreviousWorkingUnitLinear;
  151.  
  152.         // get the spacing under the previous workingUnitLinear.
  153.         //
  154.         optionVar 
  155.             -floatValue  gridSpacing              $gGridSpacingDefault
  156.             -floatValue  gridDivisions            $gGridDivisionsDefault
  157.             -floatValue  gridSize                 $gGridSizeDefault
  158.             ;
  159.  
  160.         // reset the linearUnit.
  161.         //
  162.         currentUnit -l `optionVar -q workingUnitLinear`;
  163.     }
  164.  
  165.     //    New grid display option variables for Maya 4.0. Don't include them 
  166.     //    with the default initialization of the previous grid variable like
  167.     //    size and division because they may exist in previous pref versions
  168.     //    but these new variables will not.
  169.     //
  170.     if (!`optionVar -exists displayGridAxes`) {
  171.         optionVar
  172.             -intValue    displayGridAxes               $gGridDisplayAxesDefault
  173.             -intValue    displayGridLines              $gGridDisplayGridLinesDefault
  174.             -intValue    displayDivisionLines          $gGridDisplayDivisionLinesDefault
  175.             -intValue    displayPerspGridLabels        $gGridDisplayGridPerspLabelsDefault
  176.             -intValue    displayOrthoGridLabels        $gGridDisplayGridOrthoLabelsDefault
  177.             -intValue    displayGridAxesAccented       $gGridDisplayAxesAccentedDefault
  178.             ;        
  179.     }
  180.     if (!`optionVar -exists displayGridPerspLabelPosition`) {
  181.         optionVar
  182.             -stringValue displayGridPerspLabelPosition $gGridDisplayPerspLabelPositionDefault
  183.             -stringValue displayGridOrthoLabelPosition $gGridDisplayOrthoLabelPositionDefault
  184.             ;        
  185.     }
  186.     
  187.     // set the spacing under the current working unit linear
  188.     //   
  189.     grid -toggle                     `optionVar -query showGrid`
  190.         -spacing                     `optionVar -query gridSpacing` 
  191.         -divisions                   `optionVar -query gridDivisions`
  192.         -size                        `optionVar -query gridSize`
  193.         -displayAxes                 `optionVar -query displayGridAxes`
  194.         -displayGridLines            `optionVar -query displayGridLines`
  195.         -displayDivisionLines        `optionVar -query displayDivisionLines`
  196.         -displayPerspectiveLabels    `optionVar -query displayGridPerspLabels`
  197.         -displayOrthographicLabels   `optionVar -query displayGridOrthoLabels`
  198.         -displayAxesBold             `optionVar -query displayGridAxesAccented`
  199.         -perspectiveLabelPosition    `optionVar -query displayGridPerspLabelPosition`
  200.         -orthographicLabelPosition   `optionVar -query displayGridOrthoLabelPosition`
  201.          ;
  202.  
  203.     toggle -nc -ep -state `optionVar -q newCurveDisplayEP`;
  204.     toggle -nc -hull -state `optionVar -q newCurveDisplayHull`;
  205.     toggle -nc -cv -state `optionVar -q newCurveDisplayCV`;
  206.     toggle -ns -ep -state `optionVar -q newSurfaceDisplayEP`;
  207.     toggle -ns -hull -state `optionVar -q newSurfaceDisplayHull`;
  208.     toggle -ns -cv -state `optionVar -q newSurfaceDisplayCV`;
  209.  
  210.     displaySmoothness -dc -du `optionVar -q newNurbsIsoparms`;
  211.     displaySmoothness -dc -pw `optionVar -q newNurbsPointsWire`;
  212.     displaySmoothness -dc -ps `optionVar -q newNurbsPointsShaded`;
  213.  
  214.     if (`isTrue "PolygonsExists"`) {
  215.         polyOptions -np -dv `optionVar -q newPolyVtxDisp`;
  216.         polyOptions -np -bcv `optionVar -q newPolyVtxBackCull`;
  217.  
  218.         if( `optionVar -q newPolyVertexNormals`)
  219.             if(`optionVar -q newPolyFacetNormalDisp`)
  220.                 polyOptions -np -dn 1 -pf;
  221.             else
  222.                 polyOptions -np -dn 1 -pt;
  223.         else
  224.             if(`optionVar -q newPolyFacetNormalDisp`)
  225.                 polyOptions -np -dn 1 -f;
  226.             else
  227.                 polyOptions -np -dn 0 -f;
  228.  
  229.         $state = `optionVar -q newPolyEdgeDisp`;
  230.         if( $state == 0 )
  231.             polyOptions -np -ae;
  232.         else if( $state == 1 )
  233.             polyOptions -np -se;
  234.         else if( $state == 2 )
  235.             polyOptions -np -he;
  236.  
  237.         polyOptions -np -sb `optionVar -q newPolyBorderEdgeSize`;
  238.         polyOptions -np -db `optionVar -q newPolyBorderEdgeHilite`;
  239.         polyOptions -np -dmb `optionVar -q newPolyBorderMapHilite`;
  240.         polyOptions -np -sn `optionVar -q newPolyNormalSize`;
  241.         polyOptions -np -dc `optionVar -q newPolyFacetCentreDisp`;
  242.         polyOptions -np -dt `optionVar -q newPolyFacetTrngleDisp`;
  243.         polyOptions -np -dw `optionVar -q newPolyFacetWarpDisp`;
  244.         polyOptions -np -din 
  245.         `optionVar -q newPolyNumVertexDisp`
  246.         `optionVar -q newPolyNumEdgeDisp`
  247.         `optionVar -q newPolyNumFacetDisp`
  248.         `optionVar -q newPolyNumUvDisp`; 
  249.         
  250.         $state = `optionVar -q newPolyBackFaceCull`;
  251.         if( $state == 0 )
  252.             polyOptions -np -bc;
  253.         else if( $state == 1 )
  254.             polyOptions -np -fb;
  255.         else if( $state == 2 )
  256.             polyOptions -np -wbc;
  257.         else if( $state == 3 )
  258.             polyOptions -np -hb;
  259.  
  260.         polyOptions -np -cs `optionVar -q newPolyColorShaded`;
  261.         string $colorChannelStrings[] = {"none", "ambient", "ambientDiffuse",
  262.                                          "diffuse", "specular", "emission"};
  263.         int $channel = `optionVar -q newPolyColorChannel`;
  264.         if ($channel >= 0 && $channel < 5)
  265.             polyOptions -np -cm $colorChannelStrings[$channel];
  266.         else
  267.             polyOptions -np -cm "diffuse";
  268.     }
  269.         
  270.     //
  271.     //  Manipulators
  272.     //
  273.     
  274.     global int $gRefreshMode;
  275.     $gRefreshMode = `optionVar -q refreshMode`;
  276.  
  277.     manipOptions 
  278.         -refreshMode $gRefreshMode
  279.         -scale        `optionVar -q manipGlobalScale`
  280.         -handleSize    `optionVar -q manipHandleSize`
  281.         -lineSize    `optionVar -q manipLineSize`
  282.         -linePick    `optionVar -q manipLinePickSize`
  283.         -pointSize    `optionVar -q manipPreviousStateSize`;
  284.  
  285.     animDisplay -modelUpdate interactive;
  286.     switch ($gRefreshMode) {
  287.     case 0:    // Normal
  288.         animDisplay -modelUpdate interactive;
  289.         break;
  290.     case 1:    // On Release
  291.         animDisplay -modelUpdate delayed;
  292.         break;
  293.     case 2:    // On Force
  294.         animDisplay -modelUpdate none;
  295.         break;
  296.     }
  297.  
  298.     //    Performance settings.
  299.     //
  300.     //    Valid defaults are "0", "1", and "interactive".
  301.     //
  302.     string $kDefaultStitchSurfaces          = "0";
  303.     string $kDefaultTrimDisplay             = "0";
  304.     string $kDefaultLattices                = "0";
  305.     string $kDefaultLatticeResolution       = "0";
  306.     //
  307.     //    Valid defaults are 0.0, 0.01, 0.05, and 0.1.
  308.     //    See performanceSettingsWin.mel for more info.
  309.     //
  310.     float  $kDefaultGlobalLatticeResolution = 0.01;
  311.  
  312.     //    If the performance setting preference doesn't exist then
  313.     //    create it and set to the default values.
  314.     //
  315.     if (!`optionVar -exists performanceSettingStitchSurfaces`) {
  316.         optionVar -stringValue performanceSettingStitchSurfaces
  317.             $kDefaultStitchSurfaces;
  318.     }
  319.     performanceOptions -disableStitch
  320.         `optionVar -query performanceSettingStitchSurfaces`;
  321.  
  322.     if (!`optionVar -exists performanceSettingTrimDisplay`) {
  323.         optionVar -stringValue performanceSettingTrimDisplay
  324.             $kDefaultTrimDisplay;
  325.     }
  326.     performanceOptions -disableTrimDisplay
  327.         `optionVar -query performanceSettingTrimDisplay`;
  328.  
  329.     if (!`optionVar -exists performanceSettingLattices`) {
  330.         optionVar -stringValue performanceSettingLattices
  331.             $kDefaultLattices;
  332.     }
  333.     performanceOptions -passThroughLattice
  334.         `optionVar -query performanceSettingLattices`;
  335.  
  336.     if (!`optionVar -exists performanceSettingLatticeResolution`) {
  337.         optionVar -stringValue performanceSettingLatticeResolution
  338.             $kDefaultLatticeResolution;
  339.     }
  340.     performanceOptions -useLatticeResolution
  341.         `optionVar -query performanceSettingLatticeResolution`;
  342.  
  343.     if (!`optionVar -exists performanceSettingGlobalLatticeResolution`) {
  344.         optionVar -floatValue performanceSettingGlobalLatticeResolution
  345.             $kDefaultGlobalLatticeResolution;
  346.     }
  347.     performanceOptions -latticeResolution
  348.         `optionVar -query performanceSettingGlobalLatticeResolution`;
  349.  
  350.     //    More performance settings. Notice that these are only valid
  351.     //    in the Complete version of Maya.
  352.     //
  353.     if (`licenseCheck -mode "edit" -type "complete"`) {
  354.  
  355.         //    Valid defaults are "0", "1", and "interactive".
  356.         //
  357.         string $kDefaultFlexors                 = "0";
  358.         string $kDefaultBindSkinAndFlexors      = "0";
  359.         string $kDefaultSculpts                 = "0";
  360.         string $kDefaultWires                   = "0";
  361.         string $kDefaultBlendShapes             = "0";
  362.         string $kDefaultClusters                = "0";
  363.         string $kDefaultClusterResolution       = "0";
  364.         //
  365.         //    Valid defaults are 0.0, 1.0, 5.0, or 10.0.
  366.         //    See performanceSettingsWin.mel for more info.
  367.         //
  368.         float  $kDefaultGlobalClusterResolution = 5.0;
  369.  
  370.         //    If the performance setting preference doesn't exist then
  371.         //    create it and set to the default values.
  372.         //
  373.         if (!`optionVar -exists performanceSettingFlexors`) {
  374.             optionVar -stringValue performanceSettingFlexors
  375.                 $kDefaultFlexors;
  376.         }
  377.         performanceOptions -passThroughFlexors
  378.             `optionVar -query performanceSettingFlexors`;
  379.  
  380.         if (!`optionVar -exists performanceSettingBindSkinAndFlexors`) {
  381.             optionVar -stringValue performanceSettingBindSkinAndFlexors
  382.                 $kDefaultBindSkinAndFlexors;
  383.         }
  384.         performanceOptions -passThroughBindSkinAndFlexors
  385.             `optionVar -query performanceSettingBindSkinAndFlexors`;
  386.  
  387.         if (!`optionVar -exists performanceSettingSculpts`) {
  388.             optionVar -stringValue performanceSettingSculpts
  389.                 $kDefaultSculpts;
  390.         }
  391.         performanceOptions -passThroughSculpt
  392.             `optionVar -query performanceSettingSculpts`;
  393.  
  394.         if (!`optionVar -exists performanceSettingWires`) {
  395.             optionVar -stringValue performanceSettingWires
  396.                 $kDefaultWires;
  397.         }
  398.         performanceOptions -passThroughWire
  399.             `optionVar -query performanceSettingWires`;
  400.  
  401.         if (!`optionVar -exists performanceSettingBlendShapes`) {
  402.             optionVar -stringValue performanceSettingBlendShapes
  403.                 $kDefaultBlendShapes;
  404.         }
  405.         performanceOptions -passThroughBlendShape
  406.             `optionVar -query performanceSettingBlendShapes`;
  407.  
  408.         if (!`optionVar -exists performanceSettingClusters`) {
  409.             optionVar -stringValue performanceSettingClusters
  410.                 $kDefaultClusters;
  411.         }
  412.         performanceOptions -passThroughCluster
  413.             `optionVar -query performanceSettingClusters`;
  414.  
  415.         if (!`optionVar -exists performanceSettingClusterResolution`) {
  416.             optionVar -stringValue performanceSettingClusterResolution
  417.                 $kDefaultClusterResolution;
  418.         }
  419.         performanceOptions -useClusterResolution
  420.             `optionVar -query performanceSettingClusterResolution`;
  421.  
  422.         if (!`optionVar -exists performanceSettingGlobalClusterResolution`) {
  423.             optionVar -floatValue performanceSettingGlobalClusterResolution
  424.                 $kDefaultGlobalClusterResolution;
  425.         }
  426.         performanceOptions -clusterResolution
  427.             `optionVar -query performanceSettingGlobalClusterResolution`;
  428.     }
  429.  
  430.     //
  431.     // Paint Effects
  432.     //
  433.     if(`isTrue MayaCreatorExists`) {
  434.         string $kDefaultPaintEffects                = "0";
  435.         if (!`optionVar -exists performanceSettingPaintEffects`) {
  436.             optionVar -stringValue performanceSettingPaintEffects
  437.                 $kDefaultPaintEffects;
  438.         }
  439.         performanceOptions -passThroughPaintEffects
  440.             `optionVar -query performanceSettingPaintEffects`;
  441.     }
  442.  
  443.     //
  444.     //  Modelling
  445.     //
  446.     tolerance 
  447.         -l `optionVar -q positionalTolerance`
  448.         -a `optionVar -q tangentialTolerance`;
  449.  
  450.  
  451.     // This line is causing the preferences to not be shown
  452.     // correctly in the pref window when the kin UI is not
  453.     // loaded by default.  See bug#81262 among others.
  454.     // if (`isTrue "KinematicsUIExists"`) {
  455.  
  456.     jointDisplayScale `optionVar -q ikJointDisplayScale`;
  457.     jointDisplayScale -ikfk `optionVar -q ikIkFkJointDisplayScale`;
  458.     ikHandleDisplayScale `optionVar -q ikHandleDisplayScale`;
  459.     ikfkDisplayMethod -display `optionVar -q ikIkFkDisplayMethod`;
  460.  
  461.     //
  462.     //  Dynamics
  463.     //
  464.  
  465.     if (`isTrue "DynamicsExists"`)
  466.     {
  467.         // Set the preferences into the "current preference" globals.
  468.         //
  469.         dynPref -ac `optionVar -q dynPrefAutoCreate`;
  470.         dynPref -rt `optionVar -q dynPrefRunupToCurrentTime`;
  471.         dynPref -rf `optionVar -q dynPrefRunupFrom`;
  472.         dynPref -sr `optionVar -q dynPrefSaveRuntimeState`;
  473.     }
  474.  
  475.     //
  476.     //    Initialize the filter UI.
  477.     //
  478.     source filterUI.mel;
  479.     
  480.     //
  481.     //    Initialize the help.
  482.     //
  483.     source "initHelp.mel";
  484.